<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
    <link rel="stylesheet" href="https://a.amap.com/jsapi_demos/static/demo-center/css/demo-center.css" />
    <title>地图显示</title>
    <style>
        html,
        body,
        #container {
          width: 100%;
          height: 100%;
        }
    </style>
</head>
<body id="iMap" onload="mapInit()">
	<script src="https://webapi.amap.com/maps?v=1.4.15&key=81c21357ed23f8e6d48caf443503f111"></script>
	<script>
		var map;
		var latlngXY;
		
		function mapInit(){
		    map = new AMap.Map('container', {
		        resizeEnable: true, //是否监控地图容器尺寸变化
		        zoom:15, //初始化地图层级
		        center: [117.241433,31.836224] //初始化地图中心点
		    });
		    AMap.addListener(map,'click',getLatlng)
		}
		//鼠标点击，获取经纬度坐标
		function getLatlng(e){
			map.clearMap();
			var x = e.lnglat.getLng();
			var y = e.lnglat.getLat();
		}
	</script>
</body>
</html>